{// 引入标签库 }
<tagLib name="html" />
<include file="Public:header" />
<load href='__TMPL__Common/js/colorpicker.js' />
<load href='__TMPL__Common/style/colorpicker.css' />
<script type="text/javascript">
	jQuery(function(){
		$('#colorpickerField').ColorPicker({
			onSubmit: function(hsb, hex, rgb, el) {
				$(el).val(hex);
				$(el).ColorPickerHide();
				if(hex!=""){
					$(el).css({"background":"#"+hex});
				}
				else{
					$(el).css({"background":"#FFFFFF"});
					$(el).val("");
				}
			},
			onBeforeShow: function () {
				$(this).ColorPickerSetColor(this.value);
				if(this.value!=""){
					$(this).css({"background":"#"+this.value});
				}
				else{
					$(this).css({"background":"#FFFFFF"});
					$(this).val("");
				}
			}
		})
		.bind('keyup', function(){
			$(this).ColorPickerSetColor(this.value);
			if(this.value!=""){
				$(this).css({"background":"#"+this.value});
			}
			else{
				$(this).css({"background":"#FFFFFF"});
				$(this).val("");
			}
		});
		
		$('#colorpickerField').blur(function(){
			
			if($(this).val()!=""){
				$(this).css({"background":"#"+this.value});
			}
			else{
				$(this).css({"background":"#FFFFFF"});
			}
		});
	});
</script>
<div class="main">
<div class="main_title">{%EDIT} <a href="{:u("DealLoanType/index")}" class="back_list">{%BACK_LIST}</a></div>
<div class="blank5"></div>
<form name="edit" action="__APP__" method="post" enctype="multipart/form-data">
<table class="form" cellpadding=0 cellspacing=0>
	<tr>
		<td colspan=2 class="topTd"></td>
	</tr>
	<tr>
		<td class="item_title">{%TITLE_SHOW}:</td>
		<td class="item_input"><input type="text" class="textbox require" name="name" value="{$vo.name}" /></td>
	</tr>
	<tr>
		<td class="item_title">{%DEAL_ICON}:</td>
		<td class="item_input">
			<html:imgUpload name = 'icon' id='icon' value='$vo.icon' />
		</td>
	</tr>
	<tr>
		<td class="item_title">背景色</td>
		<td class="item_input">
			<input type="text" <if condition="$vo['uname'] neq ''">style="background:#{$vo.uname};color:#fff"<else />style="color:#fff"</if> name="uname" class="textbox" maxlength="6" size="6" id="colorpickerField" value="{$vo.uname}" />
			<span clss="tip_span">不填即为默认颜色</span>
		</td>
	</tr>
	<tr>
		<td class="item_title">适宜人群</td>
		<td class="item_input">
			<input type="text" name="applyto" class="textbox" value="{$vo.applyto}" />
		</td>
	</tr>
	<tr>
		<td class="item_title">{%BRIEF}:</td>
		<td class="item_input"><textarea class="textarea" name="brief" >{$vo.brief}</textarea></td>
	</tr>
	
	<tr>
		<td class="item_title">申请条件:</td>
		<td class="item_input"><textarea class="textarea" name="condition" >{$vo.condition}</textarea></td>
	</tr>
	
	<tr>
		<td class="item_title">必要申请资料:</td>
		<td class="item_input">
			<foreach name="credit_types" item="credit" >
				<label><input type="checkbox" name="credits[]" <if condition="$credit['must'] eq 1 || in_array($credit['type'],$vo['credits'])">checked="checked"</if> <if condition="$credit['must'] eq 1">disabled="disabled"</if> value="{$credit.type}">{$credit.type_name}</label>
				&nbsp;
			</foreach>
		</td>
	</tr>
	
	<tr>
		<td class="item_title">{%IS_EFFECT}:</td>
		<td class="item_input">
			<lable>{%IS_EFFECT_1}<input type="radio" name="is_effect" value="1" <if condition="$vo['is_effect'] eq 1">checked="checked"</if> /></lable>
			<lable>{%IS_EFFECT_0}<input type="radio" name="is_effect" value="0" <if condition="$vo['is_effect'] eq 0">checked="checked"</if> /></lable>
		</td>
	</tr>

	
	<tr>
		<td class="item_title">{%SORT}:</td>
		<td class="item_input"><input type="text" class="textbox" name="sort" value="{$vo.sort}" /></td>
	</tr>
	
	<tr>
		<td class="item_title"></td>
		<td class="item_input">
			<!--隐藏元素-->
			<input type="hidden" name="id" value="{$vo.id}" />
			<input type="hidden" name="{:conf("VAR_MODULE")}" value="DealLoanType" />
			<input type="hidden" name="{:conf("VAR_ACTION")}" value="update" />
			<!--隐藏元素-->
			<input type="submit" class="button" value="{%EDIT}" />
			<input type="reset" class="button" value="{%RESET}" />
		</td>
	</tr>
	<tr>
		<td colspan=2 class="bottomTd"></td>
	</tr>
</table>	 
</form>
</div>
<include file="Public:footer" />